<?php
include_once($_SERVER['DOCUMENT_ROOT']."/config.php");
include_once($gDOCUMENT_ROOT_SYSTEM.'include/filmAction.php');
include($gDOCUMENT_ROOT_SYSTEM.'/written_language/check_written_language.php');
include_once($gDOCUMENT_ROOT_SYSTEM.'/check_promulgator.php');
if(!$userAction->canIDo('add_film'))
{
	echo $language_pack['is_not_promulgator'];
	echo '<a href="'.addon::getMovieSubjectUrl($douban_id).'">'.$language_pack['return'].'</a>';
	exit;
}

if(!isset($_POST['film_rating_CN'])||empty($_POST['film_rating_CN']))
{
	echo $language_pack['unchoose_film_rating'];
	exit;
}

$filmAction = new filmAction();
$data = $_POST;
if(isset($_POST['spoken_language_tag'])&&!empty($_POST['spoken_language_tag']))
{
	$data['spoken_language_id'] = array_sum($_POST['spoken_language_tag']);
}
$douban_id = $_POST['douban_id'];

$result = $filmAction->editFilmByDoubanId($data);

//if($result!==false)
{
	echo $language_pack['saved'].'，<a href="'.addon::getMovieSubjectUrl($douban_id).'">'.$language_pack['return'].'</a>';
}
?>
